import axios from 'axios'
import qs from "qs";

export async function getAll(supplierStatus, supplierCode) {
    let resp;
    if (Object.keys(supplierStatus).length === 0) {
        resp = await axios.get('/api/supplier/info?accountStatus=1&supplierCode=' + supplierCode);
    } else {
        resp = await axios.get('/api/supplier/info?accountStatus=' + supplierStatus + '&supplierCode=' + supplierCode);
    }
    console.log('获取到的数据')
    console.log(resp.data);
    return resp.data.data;
}

export async function updateStatus(checkMsg) {
    let resp = await axios.post('/api/supplier/info/status',
        qs.stringify({
            checkCode: checkMsg.code,
            checkStatus: checkMsg.status,
            checkMsg: checkMsg.msg
        })
    )
    return resp.data.data;
}
